package Controller.Singer;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import Dao.SingerDao;

public class singerBoardDeleteController implements Controller{
	private SingerDao dao;
	
	public void setDao(SingerDao dao) {
		this.dao = dao;
	}
	@Override
	public ModelAndView handleRequest(HttpServletRequest req,
			HttpServletResponse arg1) throws Exception {
		Integer s_no = Integer.parseInt(req.getParameter("s_no"));
		Integer sb_no = Integer.parseInt(req.getParameter("sb_no"));
		
		System.out.println("게시판 삭제 컨트롤러에 들어온 가수 시퀀스값 : " + s_no);
		System.out.println("게시판 삭제 컨트롤러에 들어온 보드 시퀀스값 : " + sb_no);
		
		dao.sboardDelete(sb_no);
		ModelAndView mav = new ModelAndView();
		mav.setViewName("redirect:/singerBoard.singer?page="+s_no+"&sb_s_no="+s_no);
		return mav;
	}
}